package love.yuanmeng.guetcoalsystem.configuration;
import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000117643465";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCU0cizK0qecADzGpyIedz8JGI1KAMt8d3ysM2GrBh1pQZUcI58/9zj3NAuPsoYzzwH9drFGM0JqvV+iptJ8fqAYwPf5hshj0ErWnzSnhKWVlBSAJ69cGD+BBOMAIa2gsdIUodH9D1AJOfoX555Q8aOslzLOkDMocgzJbWaRTcal26wOOw+CqKUDLwNGR+NZ86lfIRQAdFnFpm/tHQ/eTtPzZovCbvF4ZePeQvn6geEl67XsQ9mDDelPFGcSeasxz2IhDyPkg+yRFr4H8je0QFBIzInF8McVX4CNcy+ZT6xi2skISldWga+Cru88i6ThrzHVCSqqLpk3nxAwbgCbkY9AgMBAAECggEASb9wIwHYF43PmqlcWvFxBm6NUGREtxb98w+UuiE8echOy7d/lQhCkZTSgahSBFtmF1fJkxTIPvs+bvgHHmzQw6DNwb3JQic4l2BfLQxyj5e0c/6kq6IuHpMskJuOJpHGaduj+I9bbxca6XfBE7z3f615+KgkhoPBrz8HsKyOMxmHz/JirK+ew1JcnaRkaSwqRAxzWjcTuscZ0yTLYhm7EtlT5rujxJjL+PS/cTG0D7JhNVfKTS8Ow1USJ5KRMHD8Q391xuTdjYG36Zii6LEVcToXfr8DuAr0aSoAjgC9uTDtDGTRA5Ph3RdGxCGXobSx7zpjn7dTn+Qubsi6gc2HgQKBgQDWR0tRrBiTck4ZLS2QocxWl+Ei30yaSvyFifdhdDl4aPAahWpBst2d32t641jOyFsiQi5mrWuEbIQxSDun23lLkfPXT48P1BpgeFZAuWBcY6N2/wrrnu/9JAhQsv5phBN+PDdhTIN2MkX0DBuBnXcub41icpnBru3U2VAOgFCJoQKBgQCxy6+6qMFTcSjuqDLc687Fz/XMMhP4pGA6fEQs4scGEGUcd/2O9gbxS3dy8Ezay982lIp1KXaBZqzv6rVNFbkkQfBOwCcI5fMi+zD8VOycbbJ9G07aom5aE8B0vMd/fMr3NrUvrZsspLMt9ohnfYbgVFJBp5CSq4Va0WY46xZPHQKBgQCI7hZborYxwyHVROGRQ1PpIjVkq32wO6sTSw8i37q6D5Uf3ZIBWeP1NwjgBtiBi9dxFQnB46CJhy8Sry4wHjhs6mAAf37Uhp40d7Hmuo+xeprDOEgqOe7yvUvzBe8+ToCGcsSREOwRZB7/zZzmP1IiAnc/KizHcJnbIuPd4HGXAQKBgFv05Wa9cYAevvTwuZ3ZuJBHBvId1IZ9PegB7aDpidZxFFqtFM+kH+MdDSK9doKTf1dTbGk8kLZMzJUp56t+2MsP76JLb+UCScaF9MgNhHNDqVVbkmUyLbEZFilKmkQt3ywNd5i5SdDFPoc/Qz2DhwbvlbuvVu8FF2vpcd1ueZNhAoGAWBCTq+sFjk1KfNswREm5H0MY/vtkxdyKzTHA3arScJMXqXcniedOnK0eI0NJ4mg7zdI4ofxND8Gs6xcgHBrcAz1dyZROpYHjM1ee2ky7PWRPBVj/6pPHQPN2F/8QW0hFRlqqBc61aY05ZA4K6WYT9z6IvvuNqREDxV6lWmQ1xHk=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlNHIsytKnnAA8xqciHnc/CRiNSgDLfHd8rDNhqwYdaUGVHCOfP/c49zQLj7KGM88B/XaxRjNCar1foqbSfH6gGMD3+YbIY9BK1p80p4SllZQUgCevXBg/gQTjACGtoLHSFKHR/Q9QCTn6F+eeUPGjrJcyzpAzKHIMyW1mkU3GpdusDjsPgqilAy8DRkfjWfOpXyEUAHRZxaZv7R0P3k7T82aLwm7xeGXj3kL5+oHhJeu17EPZgw3pTxRnEnmrMc9iIQ8j5IPskRa+B/I3tEBQSMyJxfDHFV+AjXMvmU+sYtrJCEpXVoGvgq7vPIuk4a8x1Qkqqi6ZN58QMG4Am5GPQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
//    public static String return_url = "http://localhost:8071/bond/addbond";
    public static String return_url = "http://localhost:8080/#/PaySuccess";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

